package com.oa.office.biz;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.oa.office.dao.ReportTableMapper;
import com.oa.office.entity.ReportTable;
import com.oa.office.entity.ReportTableWithBLOBs;

@Service
public class ReportTableBiz {
	@Resource
	private ReportTableMapper reportTableDao;
	
	public List<ReportTableWithBLOBs> selectReportTbale(String reportType){
		return reportTableDao.selectByPrimaryKey(reportType);
		
	}
	public int insertSelective(ReportTableWithBLOBs rtwb){
		return reportTableDao.insertSelective(rtwb);
	}
	public ReportTableWithBLOBs selectReportTableLikeSpar(String spar){
		return reportTableDao.selectReportTableLikeSpar(spar);
	}
	public List<ReportTableWithBLOBs> findByEmpName(String name){
		return reportTableDao.findByEmpName(name);
	}
	public int updateReportTableWithBLOBs(ReportTableWithBLOBs rtwb){
		rtwb.setUpdateTime(new Date());
		//2表示审批通过
		rtwb.setState(2);
		return reportTableDao.updateByPrimaryKeySelective(rtwb);
	}
	public ReportTableWithBLOBs selectReportTableById(int id){
		return reportTableDao.selectReportTableById(id);
	}
}
